from rest_framework import serializers
from rest_framework.serializers import ModelSerializer
from .models import ClassInfoBackend
class ClassBackendSerializer(ModelSerializer):
    tags=serializers.CharField(max_length=50,allow_blank=True)
    class Meta:
        model = ClassInfoBackend  # 参考的model
        fields = "__all__"  # 指定要生成的字段__all__表示所有
    # mode_display = serializers.CharField(source='get_mode_display')
    # category_display = serializers.CharField(source='get_category_display')